<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<base href="<%=basePath%>">

	<title>Administrar Reserva de Hoteles</title>
	
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>
  
<body>
	<f:view>
		<h:form>
			<h:commandLink action="terminar" value="Terminar" immediate="true "/>
			<hr>
			
			<h1>Listado de Hoteles</h1>
			<h:dataTable binding="#{administrarReservasHotelBean.dataTable}" border="1" id="hoteles" value="#{administrarReservasHotelBean.reservas}" var="fila">
				<h:column>
					<h:outputText id="id" value="#{fila.id}"></h:outputText>
					<f:facet name="header">
						<h:outputText value="Id Reserva"></h:outputText>
					</f:facet>
				</h:column>
				<h:column>
					<h:outputText id="nombreHotel" value="#{fila.nombreHotel}"></h:outputText>
					<f:facet name="header">
						<h:outputText value="Hotel"></h:outputText>
					</f:facet>
				</h:column>
				<h:column>											
					<h:outputText id="CheckIn" value="#{fila.checkIn}">
						<f:convertDateTime pattern="dd/MM/yyyy" />
					</h:outputText>					
					<f:facet name="header">
						<h:outputText value="Check In"></h:outputText>
					</f:facet>
				</h:column>
				<h:column>											
					<h:outputText id="CheckOut" value="#{fila.checkOut}">
						<f:convertDateTime pattern="dd/MM/yyyy" />
					</h:outputText>					
					<f:facet name="header">
						<h:outputText value="Check Out"></h:outputText>
					</f:facet>
				</h:column>						
				
			</h:dataTable>
			<br>
			<h:commandButton action="#{administrarReservasHotelBean.crear}" value="Agregar Hotel al Paquete"/>
		</h:form>
	</f:view>
</body>
</html>